package spec.tianjunxiu.unit4.zuoyedongwu;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Qingwa extends Animal implements IAnimal,IAmphibious {
        private String sh="两栖";

        Qingwa(String n, String f, String a,String s) {
        super.eat();
        this.name=n;
        this.food=f;
        this.area=a;
        this.sh=s;
        }
        @Override
        String findFood() {
                return  this.name+"找"+this.food;
        }
        @Override
        void wholeLife() {
                System.out.println(born());
                System.out.println(old());
                System.out.println(findFood());
                System.out.println(eat());
                System.out.println(amphibious());
        }

        @Override
        public String born() {
                String n=super.getName();
                SimpleDateFormat sf=new SimpleDateFormat("yyyy年MM月dd日 HH小时mm分ss秒");
                Date d=new Date();
                String DateString= sf.format(d);
                return n + "出生于" + DateString;
        }

        @Override
        public String old() {
                String n=super.getName();
                return n+"变老了";
        }

        @Override
        public String sick() {
                String n=super.getName();
                return n+"生病了";
        }

        @Override
        public String die() {
                String n=super.getName();
                return n+"死掉了";
        }

        @Override
        public String amphibious() {
                return "青蛙既能在陆地生活也能在水里生活!";
        }
}